﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MyTest
{
    /// <summary>
    /// 教员:薛海
    /// 微信:xuehai03
    /// QQ:289477003
    /// 数据显示
    /// 2019-2-20
    /// </summary>
    public partial class FrmList : Form
    {
        public FrmList()
        {
            InitializeComponent();
        }

        List<Music> list = new List<Music>();

        int index = 0;

        public void Initial()
        {

            Music m1 = new Music();
            m1.FileNo = (index++).ToString();
            m1.FileName="QQ爱";
            m1.FileType = ".mp3";
            m1.FileSize = "123kb";
            m1.Path = @"D:\music";

            list.Add(m1);
        }

        //窗体加载事件
        private void FrmList_Load(object sender, EventArgs e)
        {

            this.Initial();
            this.dataGridView1.DataSource = list;
        }


       public FrmOwer fo;
        
        //双击控件得到第二个单元格的文本值
        private void dataGridView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {

            fo.textBox1.Text = this.dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
            //当前窗体隐藏
            this.Hide();
            
        }
    }

}
